//
//  DetailsTableViewController.m
//  KD
//
//  Created by Hubery on 15/8/19.
//  Copyright (c) 2015年 centling. All rights reserved.
//

#import "DetailsTableViewController.h"
#import "DetailsCellModel.h"
#import "TransactTableViewCell.h"
#import "ExecuteCellModel.h"
#import "DefrayViewController.h"

@interface DetailsTableViewController ()

@end

@implementation DetailsTableViewController

-(void)viewDidLoad
{
    [super viewDidLoad];
    [self adddata];
}

#pragma mark - UITableViewDelegate
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
   if(section == 1) return 64;
   else return 20;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    if (section == 1) {
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64)];
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame=CGRectMake(10,10,[UIScreen mainScreen].bounds.size.width-20, 44);
        [btn setTitle:@"支付" forState: UIControlStateNormal];
        [btn setBackgroundColor:[UIColor  blueColor]];
        [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
        [view addSubview:btn];
        return view;
    }
    return nil;
}
#pragma mark - 跳转
-(void)btnClick
{
    DefrayViewController *vc = [DefrayViewController initWithStoryBoard];
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - 添加假数据
-(void)adddata
{
    DetailsCellModel *item00 = [[DetailsCellModel alloc]initWithIcon:@"666" propertyName:@"aa" property:@"aaa" destClass:nil];
    NSArray *array1 = [NSArray arrayWithObjects:item00,nil];
    [self.oddNumberGroup addObject:array1];
    
    BaseCellModel *item10 = [[BaseCellModel alloc]initWithIcon:@"666" propertyName:@"海关状态:" property:@"海关放行"];
    DetailsCellModel *item11 = [[DetailsCellModel alloc]initWithIcon:@"666" propertyName:@"货物信息:" property:@"总数:10" destClass:nil];
    BaseCellModel *item12 = [[BaseCellModel alloc]initWithIcon:@"666" propertyName:@"逾期金额:" property:@"￥5000"];
    NSArray *array2 = [NSArray arrayWithObjects:item10,item11,item12,nil];
    [self.oddNumberGroup addObject:array2];
}

@end
